﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Entity.TEST;
using VLog;
using Data.TEST;

namespace Web.Controllers
{
    public class ErrorController : Controller
    {
        //
        // GET: /Error/
        static Web_ExceptionLog entity;
        public ActionResult Index()
        {

            ViewData["error"] = entity;
            return View();
        }
        /// <summary>
        /// 订阅写日志后的一种事件，主要是将刚写入的日志读出来
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public static void GetLastError(object sender, VLogsEventArgs e)
        {
            entity = new Repository<Web_ExceptionLog>().GetModel().FirstOrDefault(i => i.ExceptionID == e.Entity.ExceptionID);
        }
    }
}
